package com.epf.sso.server.core.model;

import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * @author epf 2018-03-22 23:51:51
 */
@Entity
@Table(name = "SYS_USER")
public class UserInfo {

    /**
     * 主键
     */
    @Id
    private String id;
    /**
     * 用户名称
     */
    @NotBlank
    private String username;
    /**
     * 真实姓名
     */
    private String realname;
    /**
     * 密码
     */
    private String password;

    private String salt;
    /**
     * 用户状态
     */
    @Column(name = "USER_STATE")
    private Integer userstate;
    /**
     * 用户所属机构ID
     */
    private String orgId;
    /**
     * 权限级别 1.超级管理员 ;2. 角色权限
     */
    @Column(name = "PERMISSION_LEVEL")
    private Integer permissionLevel;
    /**
     * 用户类型
     */
    @Transient
    private Integer userType;
    /**
     * 机构名称
     */
    @Transient
    private String orgName;

    private String telPhone;

    private String sex;

    private String address;

    private String email;
    /**
     * 邮件是否激活
     */
    @Transient
    private String emailActived;

    /**
     * 座机
     */
    private String landLine;

    private String sysUserManageId;

    @Column(name = "CREATE_TIME", insertable = true, updatable = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Column(name = "CREATE_BY", insertable = true, updatable = false)
    private String createBy;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Column(name = "UPDATE_TIME", insertable = false, updatable = true)
    private Date updateTime;

    @Column(name = "UPDATE_BY", insertable = false, updatable = true)
    private String updateBy;

    @Transient
    private int assignRole;

    private String deleteType = "0";

    @Transient
    private String roleId;

    private String iconImg;

    private String position;

    private String industryType;

    @Column(name = "WECHAT_USER_ID")
    private String wechatUserId;

    private String guid;

    @Transient
    private String userstateStr;

    /**
     * 排序
     */
    private Integer torder;

    private String affiliatedOrgId;

    private String tenantCode;
    @Transient
    private String tenantName;
    /**
     * 用户类型0后端1前段
     */
    private String usetype;

    private String deptName;
    private String transfer;//是否为调岗
    private Integer oldBusiness;//调岗：是否原部门的工作还继续处理:1是0否
    private String oldOrgid;//调岗：原机构id
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date transferTime;//调岗：调整时间
    private String remark;
    @Transient
    private String affiliatedOrgName;
    /**
     * 手签图片路径
     */
    private String handlesignIconimg;

    @Transient
    private String clientId;
    /**
     * 初始化的用户数量
     */
    @Transient
    private String initCounts;
    /**
     *  机构id集合
     */
    @Transient
    private String orgIds;

    public String getGuid() {
        return guid;
    }

    public void setGuid(String guid) {
        this.guid = guid;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getIndustryType() {
        return industryType;
    }

    public void setIndustryType(String industryType) {
        this.industryType = industryType;
    }

    public String getIconImg() {
        return iconImg;
    }

    public void setIconImg(String iconImg) {
        this.iconImg = iconImg;
    }

    @Override
    public String toString() {
        return "UserEntity [id=" + id + ", username=" + username + ", realname=" + realname + ", userstate=" + userstate
                + ", orgId=" + orgId + ", permissionLevel=" + permissionLevel + ", userType=" + userType + ", orgName="
                + orgName + ", telPhone=" + telPhone + ", sex=" + sex + ", address=" + address + ", email=" + email
                + ", landLine=" + landLine + ", sysUserManageId=" + sysUserManageId + ", createTime=" + createTime
                + ", createBy=" + createBy + ", updateTime=" + updateTime + ", updateBy=" + updateBy + ", assignRole="
                + assignRole + ", deleteType=" + deleteType + ", roleId=" + roleId + ", iconImg=" + iconImg
                + ", position=" + position + ", industryType=" + industryType + ", wechatUserId=" + wechatUserId
                + ", guid=" + guid + ", torder=" + torder + ", affiliatedOrgId=" + affiliatedOrgId + ", tenantCode="
                + tenantCode + ", tenantName=" + tenantName + ", usetype=" + usetype + ", affiliatedOrgName="
                + affiliatedOrgName + "]";
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    public String getUsername() {
        return username;
    }

    public String getWechatUserId() {
        return wechatUserId;
    }

    public void setWechatUserId(String wechatUserId) {
        this.wechatUserId = wechatUserId;
    }

    public void setUsername(String username) {
        this.username = username;
    }




    public Integer getUserstate() {
        return userstate;
    }

    public void setUserstate(Integer userstate) {
        this.userstate = userstate;
    }

    public Integer getPermissionLevel() {
        return permissionLevel;
    }

    public void setPermissionLevel(Integer permissionLevel) {
        this.permissionLevel = permissionLevel;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getRealname() {
        return realname;
    }

    public void setRealname(String realname) {
        this.realname = realname;
    }

    public String getTelPhone() {
        return telPhone;
    }

    public void setTelPhone(String telPhone) {
        this.telPhone = telPhone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public int getAssignRole() {
        return assignRole;
    }

    public void setAssignRole(int assignRole) {
        this.assignRole = assignRole;
    }

    public String getDeleteType() {
        return deleteType;
    }

    public void setDeleteType(String deleteType) {
        this.deleteType = deleteType;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getTenantName() {
        return tenantName;
    }

    public void setTenantName(String tenantName) {
        this.tenantName = tenantName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAffiliatedOrgId() {
        return affiliatedOrgId;
    }

    public void setAffiliatedOrgId(String affiliatedOrgId) {
        this.affiliatedOrgId = affiliatedOrgId;
    }

    public String getAffiliatedOrgName() {
        return affiliatedOrgName;
    }

    public void setAffiliatedOrgName(String affiliatedOrgName) {
        this.affiliatedOrgName = affiliatedOrgName;
    }

    public Integer getTorder() {
        return torder;
    }

    public void setTorder(Integer torder) {
        this.torder = torder;
    }

    public String getLandLine() {
        return landLine;
    }

    public void setLandLine(String landLine) {
        this.landLine = landLine;
    }

    public String getSysUserManageId() {
        return sysUserManageId;
    }

    public void setSysUserManageId(String sysUserManageId) {
        this.sysUserManageId = sysUserManageId;
    }

    public String getTenantCode() {
        return tenantCode;
    }

    public void setTenantCode(String tenantCode) {
        this.tenantCode = tenantCode;
    }

    public String getUsetype() {
        return usetype;
    }

    public void setUsetype(String usetype) {
        this.usetype = usetype;
    }

    public String getEmailActived() {
        return emailActived;
    }

    public void setEmailActived(String emailActived) {
        this.emailActived = emailActived;
    }

    public String getHandlesignIconimg() {
        return handlesignIconimg;
    }

    public void setHandlesignIconimg(String handlesignIconimg) {
        this.handlesignIconimg = handlesignIconimg;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getInitCounts() {
        return initCounts;
    }

    public void setInitCounts(String initCounts) {
        this.initCounts = initCounts;
    }

    public String getOrgIds() {
        return orgIds;
    }

    public void setOrgIds(String orgIds) {
        this.orgIds = orgIds;
    }

    public String getTransfer() {
        return transfer;
    }

    public void setTransfer(String transfer) {
        this.transfer = transfer;
    }

    public String getOldOrgid() {
        return oldOrgid;
    }

    public void setOldOrgid(String oldOrgid) {
        this.oldOrgid = oldOrgid;
    }

    public Date getTransferTime() {
        return transferTime;
    }

    public void setTransferTime(Date transferTime) {
        this.transferTime = transferTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getOldBusiness() {
        return oldBusiness;
    }

    public void setOldBusiness(Integer oldBusiness) {
        this.oldBusiness = oldBusiness;
    }

    public String getUserstateStr() {
        return userstateStr;
    }

    public void setUserstateStr(String userstateStr) {
        this.userstateStr = userstateStr;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }


    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }
}
